#include <stdio.h>

// 函数声明
int reverse(int number);

int main(void)
{
    int n;
    scanf("%d", &n);
    printf("%d\n", reverse(n));
    return 0;
}

// 函数定义
int reverse(int number)
{
    int rev = 0;
    while (number != 0) {
        rev = rev * 10 + number % 10;
        number /= 10;
    }
    return rev;
}